import request from '@/utils/request'

// 获取首页数据
export function getHome(query) {
  return request({
    url: '/admin/v1/index',
    method: 'get',
    params: query
  })
}
// 获取会员列表 || 白名单列表 || 获取可添加会员白名单的列表(黑名单)
export function getMemberList(query) {
  return request({
    url: '/admin/v1/user/user',
    method: 'get',
    params: query
  })
}
// 获取会员详情
export function getMemberDetail(id, query) {
  return request({
    url: `/admin/v1/user/user/${id}`,
    method: 'get',
    params: query
  })
}
// 修改会员(将会员设置成黑名单||移出黑名单||移出白名单||充值)
export function updateMember(id, query) {
  return request({
    url: `/admin/v1/user/user/${id}`,
    method: 'put',
    data: query
  })
}
// 获取拍品预览
export function getAuctionGoodPreview(query) {
  return request({
    url: '/admin/v1/product/index',
    method: 'get',
    params: query
  })
}
// 获取商品列表
export function getAuctionGoodWait(query) {
  return request({
    url: '/admin/v1/product/wait',
    method: 'get',
    params: query
  })
}
// 获取拍品列表||获取待审核拍品列表||获取上拍审核列表
export function getAuctionGoodList(query) {
  return request({
    url: '/admin/v1/product',
    method: 'get',
    params: query
  })
}
// 修改拍品(上架||下架||编辑)
export function updateAuctionGood(id, query) {
  return request({
    url: `/admin/v1/product/${id}`,
    method: 'put',
    data: query
  })
}
// 删除拍品
export function deleteAuctionGood(id) {
  return request({
    url: `/admin/v1/product/${id}`,
    method: 'delete'
  })
}
// 获取拍品已提货
export function getExtract(query) {
  return request({
    url: '/admin/v1/pick/product',
    method: 'get',
    params: query
  })
}
// 获取拍品场次
export function getField(query) {
  return request({
    url: '/admin/v1/auction',
    method: 'get',
    params: query
  })
}
// 获取拍品分类
export function getClassify(query) {
  return request({
    url: '/admin/v1/product/category',
    method: 'get',
    params: query
  })
}
// 获取拍品分类上级分类
export function getParentClassify(query) {
  return request({
    url: '/admin/v1/product/category/index',
    method: 'get',
    params: query
  })
}
// 删除拍品分类
export function deleteClassify(id) {
  return request({
    url: `/admin/v1/product/category/${id}`,
    method: 'delete'
  })
}
// 新增拍品分类
export function createClassify(data) {
  return request({
    url: '/admin/v1/product/category',
    method: 'post',
    data
  })
}
// 编辑拍品分类
export function updateClassify(id, query) {
  return request({
    url: `/admin/v1/product/category/${id}`,
    method: 'put',
    data: query
  })
}
// 获取上拍待审核||上拍已拒绝列表
export function getExhibition(query) {
  return request({
    url: '/admin/v1/product',
    method: 'get',
    params: query
  })
}
// 同意上拍||拒绝上拍
export function putExhibition(id, query) {
  return request({
    url: `/admin/v1/product/${id}`,
    method: 'put',
    data: query
  })
}
// 获取成交记录列表
export function getSuccessfulList(query) {
  return request({
    url: '/admin/v1/product/offer/record',
    method: 'get',
    params: query
  })
}
// 获取拍卖预览
export function getAuctioningPreview(query) {
  return request({
    url: '/admin/v1/auction/index',
    method: 'get',
    params: query
  })
}
// 获取拍卖管理列表
export function getAuctioningManage(query) {
  return request({
    url: '/admin/v1/auction',
    method: 'get',
    params: query
  })
}
// 删除拍卖场次
export function deleteAuctioning(id) {
  return request({
    url: `/admin/v1/auction/${id}`,
    method: 'delete'
  })
}
// 新增拍卖场次
export function createAuctioning(data) {
  return request({
    url: '/admin/v1/auction',
    method: 'post',
    data
  })
}
// 编辑拍卖场次
export function updateAuctioning(id, query) {
  return request({
    url: `/admin/v1/auction/${id}`,
    method: 'put',
    data: query
  })
}
// 获取出价记录列表
export function getBidrecord(query) {
  return request({
    url: '/admin/v1/auction/offer/record',
    method: 'get',
    params: query
  })
}
// 获取预约记录列表
export function getSubscriberecord(query) {
  return request({
    url: '/admin/v1/reservate',
    method: 'get',
    params: query
  })
}
// 获取物流公司列表
export function getKdCompanyList(query) {
  return request({
    url: '/common/kd/company',
    method: 'get',
    params: query
  })
}
// 获取物流信息
export function getKdInfoList(id, query) {
  return request({
    url: `/common/kd/info/${id}`,
    method: 'get',
    params: query
  })
}
// 获取续拍记录列表||提货订单列表
export function getOrdersList(query) {
  return request({
    url: '/admin/v1/order',
    method: 'get',
    params: query
  })
}
// 获取续拍记录详情
export function getOrdersDetail(id, query) {
  return request({
    url: `/admin/v1/order/${id}`,
    method: 'get',
    params: query
  })
}
// 修改订单
export function updateOrders(id, query) {
  return request({
    url: `/admin/v1/order/${id}`,
    method: 'put',
    data: query
  })
}
// 获取售后管理列表
export function getOrdersaftersale(query) {
  return request({
    url: '/admin/v1/order/after/sale',
    method: 'get',
    params: query
  })
}
// 获取商铺列表||分销小店列表
export function getShopping(query) {
  return request({
    url: '/admin/v1/shopping',
    method: 'get',
    params: query
  })
}
// 获取商铺详情
export function getShoppingDetail(id, query) {
  return request({
    url: `/admin/v1/shopping/${id}`,
    method: 'get',
    params: query
  })
}
// 修改商户
export function updateShopping(id, query) {
  return request({
    url: `/admin/v1/shopping/${id}`,
    method: 'put',
    data: query
  })
}
// 获取分销小店保证金记录
export function getSecuritydeposit(query) {
  return request({
    url: 'admin/v1/shopping/security',
    method: 'get',
    params: query
  })
}
// 获取商户店铺保证金记录
export function getShoppingdeposit(query) {
  return request({
    url: '/admin/v1/shopping/security/record',
    method: 'get',
    params: query
  })
}
// 获取商户结算列表
export function getShoppingpayment(query) {
  return request({
    url: '/admin/v1/settle',
    method: 'get',
    params: query
  })
}
// 获取分销管理推荐订单列表
export function getRecommendorders(query) {
  return request({
    url: '/admin/v1/sale/recommend/order',
    method: 'get',
    params: query
  })
}
// 获取分销管理佣金结算记录列表
export function getHirecost(query) {
  return request({
    url: '/admin/v1/sale/commission',
    method: 'get',
    params: query
  })
}
// 获取财务管理-充值记录列表
export function getSupplementList(query) {
  return request({
    url: '/admin/v1/finance/manage/recharge',
    method: 'get',
    params: query
  })
}
// 获取财务管理-退款记录列表
export function getRefundList(query) {
  return request({
    url: '/admin/v1/finance/manage/refund',
    method: 'get',
    params: query
  })
}
// 获取财务管理-钱包提现记录
export function getWalletCashOut(query) {
  return request({
    url: '/admin/v1/finance/manage/money',
    method: 'get',
    params: query
  })
}
// 修改财务管理-钱包提现记录
export function updateWalletCashOut(id, query) {
  return request({
    url: `/admin/v1/finance/manage/money/${id}`,
    method: 'put',
    data: query
  })
}
// 获取财务管理-退店铺保证金闭店提现列表
export function getBondcashoutList(query) {
  return request({
    url: '/admin/v1/finance/manage/margin',
    method: 'get',
    params: query
  })
}
// 修改财务管理-退店铺保证金闭店提现
export function updateBondcashout(id, query) {
  return request({
    url: `/admin/v1/finance/manage/margin/${id}`,
    method: 'put',
    data: query
  })
}
// 获取财务管理-买家保证金列表
export function getBuyersdepositList(query) {
  return request({
    url: '/admin/v1/finance/manage/security/deposit',
    method: 'get',
    params: query
  })
}
// 修改财务管理-买家保证金状态
export function updateBuyersdeposit(id, query) {
  return request({
    url: `/admin/v1/finance/manage/security/deposit/${id}`,
    method: 'put',
    data: query
  })
}
// 获取基础设置
export function getSetting(query) {
  return request({
    url: '/admin/v1/system/setting',
    method: 'get',
    params: query
  })
}
// 保存基础设置
export function updateSetting(id, query) {
  return request({
    url: `/admin/v1/system/setting/${id}`,
    method: 'put',
    data: query
  })
}
// 获取图片管理器
export function getPhoto(query) {
  return request({
    url: '/admin/v1/system/setting/image',
    method: 'get',
    params: query
  })
}
// 获取轮播图管理列表
export function getCarouselList(query) {
  return request({
    url: '/admin/v1/system/setting/slide/show',
    method: 'get',
    params: query
  })
}
// 删除轮播图
export function deleteCarousel(id) {
  return request({
    url: `/admin/v1/system/setting/slide/show/${id}`,
    method: 'delete'
  })
}
// 新增轮播图
export function createCarousel(data) {
  return request({
    url: '/admin/v1/system/setting/slide/show',
    method: 'post',
    data
  })
}
// 编辑轮播图
export function updateCarousel(id, query) {
  return request({
    url: `/admin/v1/system/setting/slide/show/${id}`,
    method: 'put',
    data: query
  })
}
// 获取平台收货地址
export function getAddress(query) {
  return request({
    url: '/admin/v1/system/setting/slide/show',
    method: 'get',
    params: query
  })
}
// 编辑平台收货地址
export function updateAddress(query) {
  return request({
    url: `/admin/v1/product/category/${id}`,
    method: 'put',
    data: query
  })
}
// 获取文章列表
export function getArticleList(query) {
  return request({
    url: '/admin/v1/article',
    method: 'get',
    params: query
  })
}
// 新增文章
export function createArticle(data) {
  return request({
    url: '/admin/v1/article',
    method: 'post',
    data
  })
}
// 编辑文章
export function updateArticle(id, query) {
  return request({
    url: `/admin/v1/article/${id}`,
    method: 'put',
    data: query
  })
}
// 删除文章
export function deleteArticle(id) {
  return request({
    url: `/admin/v1/article/${id}`,
    method: 'delete'
  })
}
// 获取交易统计列表
export function getBusinessTotal(query) {
  return request({
    url: '/admin/v1/statistical',
    method: 'get',
    params: query
  })
}
// 上传图片
export function uploadFile(data) {
  return request({
    url: '/common/upload/image',
    method: 'post',
    timeout: 300000, // 单独给接口设置请求超时的时间
    data
  })
}
// 获取上传图片的路径
export function uploadApi() {
  return process.env.VUE_APP_BASE_API + '/common/upload/image'
}
// 获取省市区
export function getArea(query) {
  return request({
    url: '/common/area/info',
    method: 'get',
    params: query
  })
}

// 删除栏目文章
export function deleteArt(data) {
  return request({
    url: '/api/backend/portalposts/delete',
    method: 'post',
    data
  })
}
// 给栏目文章定制评论
export function postArtCustomComment(data) {
  return request({
    url: '/api/backend/portalposts/comment',
    method: 'post',
    data
  })
}
// 操作日志列表
export function getActionLog(data) {
  return request({
    url: '/admin/v1/action/log',
    method: 'get',
    params: data
  })
}

// 公告管理列表
export function getNotice(data) {
  return request({
    url: '/admin/v1/notice',
    method: 'get',
    params: data
  })
}

//   公告管理新增
export function addNotice(data) {
  return request({
    url: '/admin/v1/notice',
    method: 'post',
    data: data
  })
}

// 公告管理更新
export function updateNotice(id, data) {
  return request({
    url: '/admin/v1/notice/' + id,
    method: 'put',
    data: data
  })
}

// 删除拍品
export function deleteNotice(id) {
  return request({
    url: `/admin/v1/notice/${id}`,
    method: 'delete'
  })
}

// 已提货
export function getHasPickup(data) {
  return request({
    url: '/admin/v1/product/pick/up',
    method: 'get',
    params: data
  })
}
